Algo Algo   C++   C#   Demo   JS   Py   SQL   Stat   TA

Input / Output

#include <cstdio>

int scanf( const char *format, ... )

char *gets( char *s )

// single character
char c;
scanf("%c", &c);

// decimal
int i;
long l;
scanf("%d %ld", &i, &l);

// double
double f;
scanf("%lf", &f);

// octal/hexademical
int o, x;
scanf("%o %x", &o, &x);

// unsigned
unsigned int u;
scanf("%u", &u);

// string
char s[100];
gets(s);
#include <cstdio>

int printf( const char *format, ... );

// single character
char c;
printf("", c);

// decimal
int i;
long l;
printf("%d %ld", i, l);

// double
double f;
printf("%lf", f);

// octal/hexademical
int o, x, X;
printf("%o %x % X", o, x, X);

// unsigned
unsigned int u;
printf("%u", u);

// string
char s[100];
printf("%s", s);
Algo Algo   C++   C#   Demo   JS   Py   SQL   Stat   TA